/*jq    */
$(function(){
	$(".drop_down_menu1 ul li").click(function(){
	$("#sel1").html($(this).html());
	});
});
$(function(){
	$(".drop_down_menu3 ul li").click(function(){
	$("#sel3").html($(this).html());
	});
}); 
// JavaScript Document
/*-------顶部菜单列表横向动-------*/
var myScroll;
function loaded () {
	myScroll = new IScroll('#wrapper', { eventPassthrough: true, scrollX: true, scrollY: false, preventDefault: false });
}
 

/*----------点击发布时--------*/
function release()
{
	if(document.getElementById("bgback").style.display=="block")
	{ 
	document.getElementById("bgback").style.display="none";
	document.getElementById("option").style.display="none";
	//document.getElementById("release1").style.display="none";
	//document.getElementById("release2").style.display="none";
	}
	else
	{	
	  document.getElementById("bgback").style.display="block";
	  document.getElementById("option").style.display="none";
	 // document.getElementById("release1").style.display="block";
	 // document.getElementById("release2").style.display="block";
	}
	
}

/*---------点击黑色背景时关闭发布--------*/
function offrelease()
{
	document.getElementById("bgback").style.display="none";
	//document.getElementById("release1").style.display="none";
	//document.getElementById("release2").style.display="none";
	 
}

/*-------显示和隐藏下拉菜单 ----------*/
function showdropmenu(id)
{
	if(document.getElementById(id).style.display=="block")
	{ 
	
	document.getElementById(id).style.display="none";
	 	}
	else
	{
		
	  document.getElementById(id).style.display="block";
	 
	}  
}

/*---------------------服务发布判断----------- */
function submitOK()
{
	var title=document.getElementById("title").value;
	var memo=document.getElementById("memo").value;
	var money=document.getElementById("money").value;
	var tel=document.getElementById("tel").value;
	var address=document.getElementById("address").value;
	
	 check('title');
	 check('memo');
	 check('money');
	 check('tel');
	 check('address');
}
function check(obj)
{
	if(document.getElementById(obj).value=="")
	{
	 document.getElementById(obj).style.border="2px solid #58749C";
	 document.getElementById(obj).focus();
	 
	}
	else
	{
		 document.getElementById(obj).style.border="0px";
		
	}
}
function category(id)
{ 
	clear();
	 document.getElementById('sort'+id).style.background="#58749c";
     document.getElementById('sort'+id).style.color="#ffffff";
	 
}
function clear()
{
	
	var liarr=document.getElementById("msgsort").getElementsByTagName("li");
	for(var i=0;i<liarr.length;i++)
          {			
		liarr[i].style.background="#ffffff";	
		liarr[i].style.color="#666666";
		}
}


function a1click(){
    $("#menu1").attr("href","http://").click();
    return false;    
}